package com.itheima.service;

import com.itheima.dao.GoodsMapper;
import com.itheima.pojo.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsService {
    @Autowired
    private GoodsMapper goodsMapper;

    // 查询所有商品
    public List<Goods> findAllGoods() {
        return goodsMapper.findAllGoods();
    }

    // 查询单个商品和评论
    public Goods findGoodsAndEvaluate(Integer id) {
        return goodsMapper.findGoodsAndEvaluate(id);
    }
}
